/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.PA165.musiclibraryapi.services;

import cz.muni.fi.PA165.musiclibraryapi.dto.SongDTOInterface;
import java.util.List;


/**
 * This service allows to manipulate with songs on service layer.
 *
 * @author xbogar
 */
public interface SongService {
    
    /**
     * Creates a new song and stores it into database. Id for the 
     * new song is automatically generated and stored into id attribute.
     * 
     * @param song song to be created.
     * @throws IllegalArgumentException when song is null or song is without name, 
     * author or album.
     * @throws DataAccessException something goes wrong.
     */  
    public void createSong( SongDTOInterface song);
    
    /**
     * Returns song with given id.
     * 
     * @param id primary key of requested song.
     * @return song with given id or null if such body does not exist.
     * @throws DataAccessException something goes wrong.
     */ 
    public SongDTOInterface getSong( Long id);
    
    /**
     * Returns list of all songs in the database.
     * 
     * @return list of all songs in database.
     * @throws DataAccessException something goes wrong.
     */
    public List<SongDTOInterface> getAllSongs();
    
    /**
     * Updates song in database.
     * 
     * @param song updated song to be stored into database.
     * @throws DataAccessException something goes wrong.
     */ 
    public void updateSong( SongDTOInterface song);

    /**
     * Deletes song from database. 
     * 
     * @param song song to be deleted from database.
     * @throws DataAccessException something goes wrong.
     */ 
    public void deleteSong( SongDTOInterface song);
    
}
